package com.candy.demo2;

import com.candy.jdbcutil.JDBCUtil;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class TestJDBCDbutils {
    public static void main(String[] args) throws Exception{
        Connection conn =null;
        conn=JDBCUtil.getConnection();
        PreparedStatement ps=null;
        String sql ="select * from tb_student";
        ps = conn.prepareStatement(sql);
        ResultSet rs = ps.executeQuery();
        while (rs.next()){
            System.out.println(rs.getString("tid")+"   "+rs.getString("name"));
        }

        JDBCUtil.close(conn,ps,rs);
    }
}
